import { Http } from '@/utils/Http.js'

export const LoginApi = {

	/**
	 * 账号密码登录
	 * @returns
	 */
	passwordLogin: (param) => {
		return Http.request({
			url: '/app/user/login/passwordLogin',
			method: 'post',
			data: param,
			loadingText:"登录中..."
		})
	},

	/**
	 * 验证码登录
	 * @returns
	 */
	smsLogin: (param) => {
		return Http.request({
			url: '/app/user/login/smsLogin',
			method: 'post',
			data: param,
			loadingText:"登录中..."
		})
	},

	/**
	 * 微信公众号登录
	 */
	wxLogin: (code) => {
		return Http.request({
			url: '/app/user/login/wxLogin',
			method: 'get',
			data: {code:code},
		})
	},

	/**
	 * 注册
	 * @returns
	 */
	register: (param) => {
		return Http.request({
			url: '/app/user/login/register',
			method: 'post',
			data: param,
			loadingText:"注册中..."
		})
	},

	/**
	 * 验证码登录
	 * @returns
	 */
	bindMobile: (param) => {
		return Http.request({
			url: '/app/user/login/bindMobile',
			method: 'post',
			data: param
		})
	},

	/**
	 * 发送验证码
	 * @returns
	 */
	sendVerificationCode: (data) => {
		return Http.request({
			url: '/app/user/login/sendVerificationCode',
			method: 'post',
			data: data
		})
	},

	/**
	 * 发送注册验证码
	 * @returns
	 */
	sendRegVerificationCode: (data) => {
		return Http.request({
			url: '/app/user/login/sendRegVerificationCode',
			method: 'post',
			data: data
		})
	},

	/**
	 * 发送验证码
	 * @returns
	 */
	kaptcha: () => {
		return Http.request({
			url: '/kaptcha',
			method: 'get'
		})
	},

}
